using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using WebUpdaterAdminCore.Models;

namespace WebUpdaterAdminCore.Data
{
    public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
    {
        public DbSet<ClientInfo> ClientInfos { get; set; }

        public DbSet<ClientGroup> ClientGroups { get; set; }

        public DbSet<ClientState> ClientStatus { get; set; }

        public DbSet<SendHistory> SendHistories { get; set; }

        public DbSet<FileUploadInfo> FileUploadInfos { get; set; }

        public DbSet<WebSiteInfoExtend> WebSiteInfoExtends { get; set; }
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        {
           
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            // Customize the ASP.NET Identity model and override the defaults if needed.
            // For example, you can rename the ASP.NET Identity table names and more.
            // Add your customizations after calling base.OnModelCreating(builder);
            //builder.Entity<ClientState>().HasKey(
            //    c => new { c.ClientId, c.Id }
            //    );
            
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.EnableSensitiveDataLogging(false);
            base.OnConfiguring(optionsBuilder);
        }
    }
}
